<?php echo $header; ?>
	<div class="alert-wrap">
	  	<div class="alert-system alert-position alert-fixed">
	  	</div>
	</div>
	<div class="container in-wrap">	
	    <div class="row">
		    <div class="col-md-10 col-md-offset-1">
			    <h1 class="text-center"><?php echo $maincontent; ?></h1>
		    </div>
	    </div>
	    <h3 class="text-center">邮件测试</h3>
     	<form class="form-horizontal">
     		<div class="form-group from-margin-top has-feedback">
     			<label for="" class="control-label col-md-2 col-md-offset-1">邮件地址</label>
     			<div class="col-md-6">
     				<div class="input-group">
     					<input type="text" name="email-test" id="email-test" class="form-control" placeholder="填写测试邮件">
     					<a class="input-group-addon btn btn-defalut" href="javascript:void(0);" id="send-email-button">发送测试邮件</a>
     				</div>
     			</div>
     		</div>
     	</form>
	</div>
	<div class="container in-wrap">	
	    <h3 class="text-center">设置默认标签</h3>
	    <h5 class = "text-center">创建新的知识点时会被自动填入的标签.</h5>
     	<form class="form-horizontal">
     		<div class="form-group from-margin-top has-feedback">
     			<label for="" class="control-label col-md-2 col-md-offset-1">默认标签</label>
     			<div class="col-md-6">
     				<div class="input-group">
     					<input type="text" name="default-label" id="default-label" class="form-control" placeholder="<?php echo $defaultlabel; ?>">
     					<a class="input-group-addon btn btn-defalut" href="javascript:void(0);" id="set-default-label">确定</a>
     				</div>
     			</div>
     		</div>
     	</form>
	</div>
	<div class="container in-wrap">
			<h3 class="text-center">自定义复习时间</h3>
			<h5 class = "text-center">注意:只有在修改复习时间的时间点后添加的知识点会使用新的复习时间.</h5>
	    <form action="" class="form-horizontal form-two">
			<!-- <div class="form-group from-margin-top has-feedback">
	     		<label for="" class="control-label col-md-2 col-md-offset-1">第一次</label>
	     		<div class="col-md-6">
	     			<div class="input-group date date-first" data-date-format="hh:ii">
	     				<input type="text" name="first-time" id="first-time" class="form-control" placeholder="HH:MM:SS">
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-remove"></span>
	     				</span>
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-calendar"></span>
	     				</span>
	     				<span class="input-group-addon sure-1">确定</span>
	     			</div>
	     		</div>
	     	</div>
	     	<div class="form-group from-margin-top has-feedback">
	     		<label for="" class="control-label col-md-2 col-md-offset-1">第二次</label>
	     		<div class="col-md-6">
	     			<div class="input-group date date-second" data-date-format="HH:ii:ss">
	     				<input type="text" name="second-time" id="second-time" class="form-control" placeholder="HH:MM:SS">
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-remove"></span>
	     				</span>
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-calendar"></span>
	     				</span>
	     				<span class="input-group-addon sure-2">确定</span>
	     			</div>
	     		</div>
	     	</div> 
	     	<div class="form-group from-margin-top has-feedback">
	     		<label for="" class="control-label col-md-2 col-md-offset-1">第三次</label>
	     		<div class="col-md-6">
	     			<div class="input-group date date-third" data-date-format="hh:ii">
	     				<input type="text" name="third-time" id="third-time" class="form-control" placeholder="hh:ii">
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-remove"></span>
	     				</span>
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-calendar"></span>
	     				</span>
	     				<span class="input-group-addon sure-3">确定</span>
	     			</div>
	     		</div>
	     	</div>-->
	     	<div class="form-group from-margin-top has-feedback">
	     		<label for="" class="control-label col-md-2 col-md-offset-1">第四次</label>
	     		<div class="col-md-6">
	     			<div class="input-group date date-forth" data-date-format="hh:ii:ss">
	     				<input type="text" name="forth-time" id="4-time" class="form-control cursor-not-allowed" readonly="" placeholder="<?php echo $reviewdate4; ?>">
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-remove"></span>
	     				</span>
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-calendar"></span>
	     				</span>
	     				<span class="input-group-addon sure-4 btn btn-defalut sure-btn" data-times="4">确定</span>
	     			</div>
	     		</div>
	     	</div>
	     	<div class="form-group from-margin-top has-feedback">
	     		<label for="" class="control-label col-md-2 col-md-offset-1">第五次</label>
	     		<div class="col-md-6">
	     			<div class="input-group date date-fifth" data-date-format="hh:ii:ss">
	     				<input type="text" name="fifth-time" id="5-time" class="form-control cursor-not-allowed" readonly="" placeholder="<?php echo $reviewdate5; ?>">
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-remove"></span>
	     				</span>
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-calendar"></span>
	     				</span>
	     				<span class="input-group-addon sure-5 btn btn-defalut sure-btn" data-times="5">确定</span>
	     			</div>
	     		</div>
	     	</div>
	     	<div class="form-group from-margin-top has-feedback">
	     		<label for="" class="control-label col-md-2 col-md-offset-1">第六次</label>
	     		<div class="col-md-6">
	     			<div class="input-group date date-sixth" data-date-format="hh:ii:ss">
	     				<input type="text" name="sixth-time" id="6-time" class="form-control cursor-not-allowed" readonly="" placeholder="<?php echo $reviewdate6; ?>">
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-remove"></span>
	     				</span>
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-calendar"></span>
	     				</span>
	     				<span class="input-group-addon sure-6 btn btn-defalut sure-btn" data-times="6">确定</span>
	     			</div>
	     		</div>
	     	</div>
	     	<div class="form-group from-margin-top has-feedback">
	     		<label for="" class="control-label col-md-2 col-md-offset-1">第七次</label>
	     		<div class="col-md-6">
	     			<div class="input-group date date-seventh" data-date-format="hh:ii:ss">
	     				<input type="text" name="seventh-time" id="7-time" class="form-control cursor-not-allowed" readonly="" placeholder="<?php echo $reviewdate7; ?>">
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-remove"></span>
	     				</span>
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-calendar"></span>
	     				</span>
	     				<span class="input-group-addon sure-7 btn btn-defalut sure-btn" data-times="7">确定</span>
	     			</div>
	     		</div>
	     	</div>
	     	<div class="form-group from-margin-top has-feedback">
	     		<label for="" class="control-label col-md-2 col-md-offset-1">第八次</label>
	     		<div class="col-md-6">
	     			<div class="input-group date date-eighth" data-date-format="hh:ii:ss">
	     				<input type="text" name="eighth-time" id="8-time" class="form-control cursor-not-allowed" readonly="" placeholder="<?php echo $reviewdate8; ?>">
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-remove"></span>
	     				</span>
	     				<span class="input-group-addon">
	     					<span class="glyphicon glyphicon-calendar"></span>
	     				</span>
	     				<span class="input-group-addon sure-8 btn btn-defalut sure-btn" data-times="8">确定</span>
	     			</div>
	     		</div>
	     	</div>
	    </form>
    </div>

<?php echo $footerin;?>
<script>
	$(function(){
		var $alerttarget = $(".alert-system");
		/*$('.date-first').datetimepicker({
			container:$(".form-two"),
			startView:1
		});
		$('.date-second').datetimepicker({
			container:$(".form-two"),
			startView:1
		});
		$('.date-third').datetimepicker({
			container:$(".form-two"),
			startView:1
		});*/
		$('.date-forth').datetimepicker({
			container:$(".form-two"),
			startView:1,
			autoclose:true
		});
		$('.date-fifth').datetimepicker({
			container:$(".form-two"),
			startView:1,
			autoclose:true
		});
		$('.date-sixth').datetimepicker({
			container:$(".form-two"),
			startView:1,
			autoclose:true
		});
		$('.date-seventh').datetimepicker({
			container:$(".form-two"),
			startView:1,
			autoclose:true
		});
		$('.date-eighth').datetimepicker({
			container:$(".form-two"),
			startView:1,
			autoclose:true
		});
		//点击确定修改复习时间
		$(".sure-btn").click(function(){
			var times = $(this).data("times");
			var review_date = $("#"+times+"-time").val();
			if (review_date == "") {
				alert2000($alerttarget,"时间不能为空");
				return false;
			}
			$.ajax({
		          type:"POST",
		          dataType:"json",
		          url:"<?php echo $edittimeurl; ?>",
		          data:{times:times,review_date:review_date+":00"},
		          beforeSend: function() {
		              var idinfo = '正在修改复习时间，请稍后……';
		                  alert2000($alerttarget,idinfo);
		          },
		          success: function (data){
		          	if(data){
		          		var info = "复习时间修改成功！";
						alertjts($alerttarget,info);
		          	}
		          }
	        })
		})
		//测试邮件发送
		$("#send-email-button").click(function(){
			var email = $('#email-test').val();
			if(!email_vel(email,$alerttarget)){
				return false;
			};
			$.ajax({
		          type:"POST",
		          dataType:"json",
		          url:"<?php echo $sendemailurl; ?>",
		          data:{email:email},
		          beforeSend: function() {
		              var idinfo = '正在发送邮件请稍后……';
		                  alert2000($alerttarget,idinfo);
		          },
		          success: function (data){
		          	if(data){
		          		var info = "测试邮件发送成功！";
						alertjts($alerttarget,info);
		          	}
		          }
	        })
		})
		//设置默认标签
		$("#set-default-label").click(function(){
			var label = $('#default-label').val();
			if(e = klabel_vel(label,2)){
				alert2000($alerttarget, e);
				return false;
			};
			$.ajax({
		          type:"POST",
		          dataType:"json",
		          url:"<?php echo $setdefaultlabelurl; ?>",
		          data:{label:label},
		          beforeSend: function() {
		              var idinfo = '正在设置默认标签请稍后……';
		                  alert2000($alerttarget,idinfo);
		          },
		          success: function (data){
		          	if(data){
		          		var info = "默认标签设置成功！";
						alertjts($alerttarget,info);
		          	}
		          }
	        })
		})
	})
</script>
<?php echo $footer;?>